package com.ruoyi.apis.vo;

import com.ruoyi.apis.entity.OfflineEntity;
import com.ruoyi.apis.entity.VideoEntity;
import com.ruoyi.apis.utils.ResponseUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author Choi
 * @Date 2021/7/19
 */

@Setter
@Getter
public class VideoVO {
    private Long id;
    private String title;
    private String image;
    private String intro;
    private String video;
    private String description;
    private String[] images;

    public VideoVO(VideoEntity video) {
        BeanUtils.copyProperties(video, this);
//        this.video = ResponseUtils.getFulImage(video.getVideo());
//        this.image = ResponseUtils.getFulImage(video.getImage());
        this.images = ResponseUtils.getImages(video.getImages());
    }

    public static List<VideoVO> getVideoList(List<VideoEntity> videos) {
        return videos.stream()
                .map(VideoVO::new)
                .collect(Collectors.toList());
    }


}
